define(function(require,exports,module){
	var Subnav = require("subnav");
	var user = require("store").get("user");
	
	module.exports = {
		initComponent: function(widget){
			var subnav = new Subnav({
				parentNode: ".J-subnav",
				model: {
					title: "组团预约",
					items: [{
						id: "alliance",
						tip: "机构",
						type: "buttongroup",
						items: [{
							key: "false",
							value: "本机构"
						},{
							key: "true",
							value: "联盟单位"
						}],
						handler: function(){
							widget.get("grid").refresh();
						}
					},{
						id: "servicePoint",
						type: "buttongroup",
						items:user.privateServicePoints,
						tip: "服务点",
						keyField: "pkServicePoint",
						valueField: "name",
						handler: function(){
							widget.get("grid").refresh();
						}
					},{
						id: "destination",
						tip: "目的地",
						type: "buttongroup",
						url: "api/destination/query",
						keyField: "pkDestination",
						valueField: "name",
						all: {
							show: true
						},
						handler: function(){
							widget.get("grid").refresh();
						}
					},{
						id: "time",
						tip: "开始日期",
						type: "daterange",
						handler: function(){
							widget.get("grid").refresh();
						}
					},{
						id: "return",
						type: "button",
						text: "返回",
						show: false,
						handler: function(){
							widget.toList();
						}
					},{
						id: "buildings",
						type: "buttongroup",
						show:false,
						tip: "楼宇",
						keyField: "pkOrgBuilding",
						valueField: "name",
						handler: function(){
							widget.handler.appointComp.handleBuildChange(widget);
						}
					},{
						id: "roomTypes",
						type: "buttongroup",
						show:false,
						tip: "房型",
						keyField: "pkRoomType",
						valueField: "name",
						handler: function(){
							widget.handler.appointComp.handleRoomTypeChange(widget);
						}
					},{
						id: "appointTime",
						type: "daterange",
						show: false,
						handler: function(){
							widget.handler.appointComp.handleCheckInDateChange(widget);
						}
					}]
				}
			});
			widget.set("subnav",subnav);
		}
	};
});